<?php
/**
 * bView
 *
 * Classe d'abstraction des vues
 *
 * @package bottleneck
 * @subpackage core
 * @author Thomas Lenoel
 * @copyright 2010 Thomas Lenoel
 * @version 0.1
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License version 3
 */
abstract class bView {

    protected  $type;

    protected $decorator;

    protected $body;

    // @codeCoverageIgnoreStart
    private function  __construct() {}
    // @codeCoverageIgnoreEnd

    public static function getInstance($type='raw') {

        static $_view = null;
        
        $path = dirname(__FILE__).'/view/'.$type.'.view.php';
        require_once $path;

        $class = $type.'View';

//        if (empty(self::$_view)) self::$_view = new $class;
//        return self::$_view;

        if (!isset($_view)) $_view = new $class;
        return $_view;
    }

    public abstract function render();
}
?>
